import '../api/json_placeholder_api.dart';
import '../model/order.dart';
import '../model/api_response.dart';

class OrderRepository {
  // 获取用户订单
  Future<ApiResponse<List<Order>>> getUserOrders(String userId) async {
    return await JsonPlaceholderApi.getUserOrders(userId);
  }

  // 创建订单
  Future<ApiResponse<Order>> createOrder(Order order) async {
    return await JsonPlaceholderApi.createOrder(order);
  }

  // 更新订单状态
  Future<ApiResponse<Order>> updateOrderStatus(
      String orderId,
      String newStatus
      ) async {
    return await JsonPlaceholderApi.updateOrderStatus(orderId, newStatus);
  }
}